package dao;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import util.JpaUtil;
import entity.*;

public class ItemDao {
	EntityManager em = JpaUtil.getEntityManager();
	
	public List<Item> selectItems() {
    	
    	Query q = em.createQuery("SELECT um FROM Item um");

		if(q.getResultList().size() != 0){
			return  (List<Item>) q.getResultList();
		}
		else
			return null;
    }
}